package com.qianf.qfoffice.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.util.Date;

public class Skill implements Serializable {

    private int id;

    private String content;

    /*
     * @JsonFormat(pattern = "yyyy--MM-dd HH:mm:ss",timezone = "GMT+8")
     * 将json中的将 转换为 java date
     * 返回json数据可以将date转为yyyy--MM-dd HH:mm:ss
     * */
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    /*
     * @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
     * 接收对象时 将属性 yyyy-MM-dd HH:mm:ss -----> date
     * */
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createtime;

    private String uno;

    public Skill () {

    }

    public Skill(int id, String content, Date createtime, String uno) {
        this.id = id;
        this.content = content;
        this.createtime = createtime;
        this.uno = uno;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public Date getCreatetime() {

        this.createtime = new Date();

        return createtime;
    }

    public void setCreatetime(Date createtime) {
        this.createtime = createtime;
    }

    public String getUno() {
        return uno;
    }

    public void setUno(String uno) {
        this.uno = uno;
    }

    @Override
    public String toString() {
        return "Skill{" +
                "id=" + id +
                ", content='" + content + '\'' +
                ", createtime=" + createtime +
                ", uno='" + uno + '\'' +
                '}';
    }
}
